#pragma once
#include "Sensor.h"
#include "sensorutility_global.h"
#include <fstream>
#include <QTimer>


class SENSORUTILITY_EXPORT FileSensor : public Sensor
{
	Q_OBJECT
private:

	std::ifstream _inStream;
	char *_buf;
	bool _hasNewFrame;
	int _frameDataSize;
	QTimer *_pTimer;
	bool _isStarted;


public:

	FileSensor (const QString &name, const QString &dataFile,
			const QString &intrinsicFile = "../Data/Intrinsic/default.int",
			const QString &extrinsicFile = "");

	virtual ~FileSensor ();

	virtual void start ();

	virtual void stop ();

public slots:
	void grabFrame ();

};